
<%@ page import="workforecast.Forecast" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main2">
		<g:set var="entityName" value="${message(code: 'forecast.label', default: 'Forecast')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-forecast" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="back" href="${createLink(action: 'home', controller:'user')}">Back</a></li>
				<li><a class="home" href="${createLink(action: 'home', controller:'user')}">Home</a></li>
				<li><a class="logout" href="${createLink(action: 'logout', controller:'user')}">Logout</a></li>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="list-forecast" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
						<th><g:message code="forecast.id" default="#" /></th>
					
						<th><g:message code="forecast.user.username" default="User" /></th>
						
						<th><g:message code="forecast.startWeek" default="Start Week" /></th>
						
						<th><g:message code="forecast.endWeek" default="End Week" /></th>
						
						<th><g:message code="forecast.activities.size()" default="Activities" /></th>
						
						<th><g:message code="forecast.activities*.workloadEstimation.sum()" default="Total Workload" /></th>
					</tr>
				</thead>
				<tbody>
				<g:each in="${forecastInstanceList}" status="i" var="forecastInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${forecastInstance.id}">${forecastInstance.id}</g:link></td>

						<td>${fieldValue(bean: forecastInstance, field: "user.username")}</td>
						
						<td>${forecastInstance.startWeek} / ${forecastInstance.startYear}</td>
						
						<td>${forecastInstance.endWeek} / ${forecastInstance.endYear}</td>
					
						<td>${forecastInstance.activities.size()}</td>
						
						<td>${forecastInstance.activities*.workloadEstimation.sum()}</td>
											
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${forecastInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
